/*
 *http://www.apache.org/licenses/LICENSE-2.0
 *Copyright (c) 2021 fullset
 *@ClassName SysMenuDaoImpl
 *@date 2021/6/5 11:11
 *@Description TODO
 */
package com.fs.orm.dao.Impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.fs.orm.dao.SysMenuDao;
import com.fs.orm.entity.SysMenu;
import com.fs.orm.entity.SysUser;
import com.fs.orm.mapper.SysMenuMapper;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public class SysMenuDaoImpl extends ServiceImpl<SysMenuMapper, SysMenu> implements SysMenuDao {

    @Override
    public boolean logicalDeleteById(String id) {
        SysMenu sysMenu = new SysMenu();
        sysMenu.setIsDeleted(1);
        UpdateWrapper<SysMenu> menuUpdateWrapper = new UpdateWrapper<>();
        menuUpdateWrapper.eq("id", id);
        int update = baseMapper.update(sysMenu, menuUpdateWrapper);
        return update > 0 ? true : false;
    }

    @Override
    public List<SysMenu> getList(QueryWrapper qWrapper) {
        return baseMapper.selectList(qWrapper);
    }
}
